]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: fix crash when bluetooth is disabled
authorOlivier Blin <dev@blino.org>
Tue, 3 Sep 2013 23:22:46 +0000 (01:22 +0200)
committerOlav Vitters <olav@vitters.nl>
Wed, 4 Sep 2013 09:34:17 +0000 (11:34 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=707430

js/ui/panel.js

index aaabad1a9069e30ce3cb63ce92a5d1c10b9cff19..c6c1abc758ba85dad09d840909115a120e4af8a7 100644 (file)
@@ -809,7 +809,12 @@ const AggregateMenu = new Lang.Class({
         this.actor.add_child(this._indicators);
 
         this._network = new imports.ui.status.network.NMApplet();
-        this._bluetooth = new imports.ui.status.bluetooth.Indicator();
+        if (Config.HAVE_BLUETOOTH) {
+            this._bluetooth = new imports.ui.status.bluetooth.Indicator();
+        } else {
+            this._bluetooth = null;
+        }
+
         this._power = new imports.ui.status.power.Indicator();
         this._rfkill = new imports.ui.status.rfkill.Indicator();
         this._volume = new imports.ui.status.volume.Indicator();
@@ -819,7 +824,9 @@ const AggregateMenu = new Lang.Class({
 
         this._indicators.add_child(this._screencast.indicators);
         this._indicators.add_child(this._network.indicators);
-        this._indicators.add_child(this._bluetooth.indicators);
+        if (this._bluetooth) {
+            this._indicators.add_child(this._bluetooth.indicators);
+        }
         this._indicators.add_child(this._rfkill.indicators);
         this._indicators.add_child(this._volume.indicators);
         this._indicators.add_child(this._power.indicators);
@@ -831,7 +838,9 @@ const AggregateMenu = new Lang.Class({
         this.menu.addMenuItem(this._brightness.menu);
         this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
         this.menu.addMenuItem(this._network.menu);
-        this.menu.addMenuItem(this._bluetooth.menu);
+        if (this._bluetooth) {
+            this.menu.addMenuItem(this._bluetooth.menu);
+        }
         this.menu.addMenuItem(this._rfkill.menu);
         this.menu.addMenuItem(this._power.menu);
         this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());